package com.example.lib_base

import android.content.Context
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment


/**
 * @Description:
 * @Author: Seal
 * @CreateDate: 2020/7/9 16:03
 * @Version: 1.0
 */
abstract class BaseFragment : Fragment() {
    val TAG = javaClass::class.java.simpleName

    override fun onAttach(context: Context) {
        super.onAttach(context)
        Log.d(TAG, "onAttach: ")
    }

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        Log.d(TAG, "onCreateView: ")
        return super.onCreateView(inflater, container, savedInstanceState)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        Log.d(TAG, "onViewCreated: ")
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

//        val parentFragment = parentFragment
//        if (parentFragment == null) {
//            if (activity is ViewTarget) {
//                parent = activity as ViewTarget?
//            }
//        } else {
//            parent = parentFragment as ViewTarget?
//        }
    }

//    fun execute(methodName: String?, vararg args: Any?) {
//        if (parent != null) {
//            parent.execute(methodName, args)
//        }
//    }
}
